package com.hqj.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hqj.dao.UserMapper;
import com.hqj.entity.User;
import com.hqj.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
/**
 * @author 黄啟军
 * @version 1.0
 * @date 2020/5/16/016
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User findUser(String username) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("username",username);
        return userMapper.selectOne(wrapper);
    }

    @Override
    public User findById(Long id) {
        return userMapper.selectById(id);
    }
}
